from PySide import QtGui

def fileNew(parent):
	fileAction = QtGui.QAction(QtGui.QIcon('new.png'), 'New', parent)
	fileAction.setShortcut('Ctrl+N')
	fileAction.setStatusTip('Create a new model')
	fileAction.triggered.connect(parent.fileio.fileNew)
	return fileAction

def fileOpen(parent):
	fileAction = QtGui.QAction(QtGui.QIcon('open.png'), 'Open', parent)
	fileAction.setShortcut('Ctrl+O')
	fileAction.setStatusTip('Open a model')
	fileAction.triggered.connect(parent.fileio.fileOpen)
	return fileAction

def fileSave(parent):
	fileAction = QtGui.QAction(QtGui.QIcon('save.png'), 'Save', parent)
	fileAction.setShortcut('Ctrl+S')
	fileAction.setStatusTip('Save current model')
	fileAction.triggered.connect(parent.fileio.fileSave)
	return fileAction

def fileSaveAs(parent):
	fileAction = QtGui.QAction(QtGui.QIcon('saveas.png'), 'Save As', parent)
	fileAction.setShortcut('Ctrl+Shift+S')
	fileAction.setStatusTip('Save current model with different name')
	fileAction.triggered.connect(parent.fileio.fileSaveAs)
	return fileAction

def exit(parent):
	exitAction = QtGui.QAction(QtGui.QIcon('exit.png'), 'Exit', parent)
	exitAction.setShortcut('Ctrl+Q')
	exitAction.setStatusTip('Exit tensile-structures')
	exitAction.triggered.connect(parent.close)
	return exitAction
